/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "usuturno")
@NamedQueries({@NamedQuery(name = "Usuturno.findByUstCodigo", query = "SELECT u FROM Usuturno u WHERE u.ustCodigo = :ustCodigo"), @NamedQuery(name = "Usuturno.findByUstApellido", query = "SELECT u FROM Usuturno u WHERE u.ustApellido = :ustApellido"), @NamedQuery(name = "Usuturno.findByUstNombre", query = "SELECT u FROM Usuturno u WHERE u.ustNombre = :ustNombre"), @NamedQuery(name = "Usuturno.findByUstLogin", query = "SELECT u FROM Usuturno u WHERE u.ustLogin = :ustLogin"), @NamedQuery(name = "Usuturno.findByUstPassword", query = "SELECT u FROM Usuturno u WHERE u.ustPassword = :ustPassword"), @NamedQuery(name = "Usuturno.findByUstEstado", query = "SELECT u FROM Usuturno u WHERE u.ustEstado = :ustEstado"), @NamedQuery(name = "Usuturno.findByUstFecha", query = "SELECT u FROM Usuturno u WHERE u.ustFecha = :ustFecha"), @NamedQuery(name = "Usuturno.findByUstHora", query = "SELECT u FROM Usuturno u WHERE u.ustHora = :ustHora"), @NamedQuery(name = "Usuturno.findByUstResponsable", query = "SELECT u FROM Usuturno u WHERE u.ustResponsable = :ustResponsable"), @NamedQuery(name = "Usuturno.findByUstContra", query = "SELECT u FROM Usuturno u WHERE u.ustContra = :ustContra")})
public class Usuturno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "UST_CODIGO", nullable = false)
    private Integer ustCodigo;
    @Column(name = "UST_APELLIDO", nullable = false)
    private String ustApellido;
    @Column(name = "UST_NOMBRE", nullable = false)
    private String ustNombre;
    @Column(name = "UST_LOGIN", nullable = false)
    private String ustLogin;
    @Column(name = "UST_PASSWORD")
    private String ustPassword;
    @Column(name = "UST_ESTADO")
    private Integer ustEstado;
    @Column(name = "UST_FECHA")
    @Temporal(TemporalType.DATE)
    private Date ustFecha;
    @Column(name = "UST_HORA")
    @Temporal(TemporalType.TIME)
    private Date ustHora;
    @Column(name = "UST_RESPONSABLE", nullable = false)
    private String ustResponsable;
    @Column(name = "UST_CONTRA")
    private String ustContra;
    @JoinColumn(name = "PAC_CODIGO", referencedColumnName = "PAC_CODIGO")
    @ManyToOne
    private Paciente pacCodigo;

    public Usuturno() {
    }

    public Usuturno(Integer ustCodigo) {
        this.ustCodigo = ustCodigo;
    }

    public Usuturno(Integer ustCodigo, String ustApellido, String ustNombre, String ustLogin, String ustResponsable) {
        this.ustCodigo = ustCodigo;
        this.ustApellido = ustApellido;
        this.ustNombre = ustNombre;
        this.ustLogin = ustLogin;
        this.ustResponsable = ustResponsable;
    }

    public Integer getUstCodigo() {
        return ustCodigo;
    }

    public void setUstCodigo(Integer ustCodigo) {
        this.ustCodigo = ustCodigo;
    }

    public String getUstApellido() {
        return ustApellido;
    }

    public void setUstApellido(String ustApellido) {
        this.ustApellido = ustApellido;
    }

    public String getUstNombre() {
        return ustNombre;
    }

    public void setUstNombre(String ustNombre) {
        this.ustNombre = ustNombre;
    }

    public String getUstLogin() {
        return ustLogin;
    }

    public void setUstLogin(String ustLogin) {
        this.ustLogin = ustLogin;
    }

    public String getUstPassword() {
        return ustPassword;
    }

    public void setUstPassword(String ustPassword) {
        this.ustPassword = ustPassword;
    }

    public Integer getUstEstado() {
        return ustEstado;
    }

    public void setUstEstado(Integer ustEstado) {
        this.ustEstado = ustEstado;
    }

    public Date getUstFecha() {
        return ustFecha;
    }

    public void setUstFecha(Date ustFecha) {
        this.ustFecha = ustFecha;
    }

    public Date getUstHora() {
        return ustHora;
    }

    public void setUstHora(Date ustHora) {
        this.ustHora = ustHora;
    }

    public String getUstResponsable() {
        return ustResponsable;
    }

    public void setUstResponsable(String ustResponsable) {
        this.ustResponsable = ustResponsable;
    }

    public String getUstContra() {
        return ustContra;
    }

    public void setUstContra(String ustContra) {
        this.ustContra = ustContra;
    }

    public Paciente getPacCodigo() {
        return pacCodigo;
    }

    public void setPacCodigo(Paciente pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ustCodigo != null ? ustCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuturno)) {
            return false;
        }
        Usuturno other = (Usuturno) object;
        if ((this.ustCodigo == null && other.ustCodigo != null) || (this.ustCodigo != null && !this.ustCodigo.equals(other.ustCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Usuturno[ustCodigo=" + ustCodigo + "]";
    }

}
